package com.cq.utils;

import com.cq.pojo.Alog;
import com.cq.pojo.AlogAvg;
import com.cq.pojo.AlogDiff;

public class AlogUtil {

    public static AlogDiff getAlogDiff(Alog alog, AlogAvg alogAvg) {
        AlogDiff diff = new AlogDiff();
        diff.setCacDiff(alog.getCac().subtract(alogAvg.getCacAvg()));
        diff.setCpmDiff(alog.getCpm().subtract(alogAvg.getCpmAvg()));
        diff.setRoiDiff(alog.getRoi().subtract(alogAvg.getRoiAvg()));
        diff.setMamcRateDiff(alog.getMamcRate().subtract(alogAvg.getMamcRateAvg()));
        diff.setMamcGMVRateDiff(alog.getMamcGMVRate().subtract(alogAvg.getMamcGMVRateAvg()));
        diff.setRnmRoiDiff(alog.getRnmRoi().subtract(alogAvg.getRnmRoiAvg()));
        diff.setRnmCacDiff(alog.getRnmCac().subtract(alogAvg.getRnmCacAvg()));
        diff.setNmcRateDiff(alog.getNmcRate().subtract(alogAvg.getNmcRateAvg()));
        diff.setNmcGMVRateDiff(alog.getNmcGMVRate().subtract(alogAvg.getNmcGMVRateAvg()));
        diff.setPcmaGMVDiff(alog.getPcmaGMV().subtract(alogAvg.getPcmaGMVAvg()));
        diff.setMpcmaGMVDiff(alog.getMpcmaGMV().subtract(alogAvg.getMpcmaGMVAvg()));
        diff.setPcnGMVDiff(alog.getPcnGMV().subtract(alogAvg.getPcnGMVAvg()));
        diff.setPanGMVDiff(alog.getPanGMV().subtract(alogAvg.getPanGMVAvg()));
        diff.setMasmRateDiff(alog.getMasmRate().subtract(alogAvg.getMasmRateAvg()));
        diff.setMrrRateDiff(alog.getMrrRate().subtract(alogAvg.getMrrRateAvg()));

        return diff;
    }

    public static AlogDiff getAlogDiff(Alog alogA, Alog alogB) {
        AlogDiff diff = new AlogDiff();
        diff.setCacDiff(alogA.getCac().subtract(alogB.getCac()));
        diff.setCpmDiff(alogA.getCpm().subtract(alogB.getCpm()));
        diff.setRoiDiff(alogA.getRoi().subtract(alogB.getRoi()));
        diff.setMamcRateDiff(alogA.getMamcRate().subtract(alogB.getMamcRate()));
        diff.setMamcGMVRateDiff(alogA.getMamcGMVRate().subtract(alogB.getMamcGMVRate()));
        diff.setRnmRoiDiff(alogA.getRnmRoi().subtract(alogB.getRnmRoi()));
        diff.setRnmCacDiff(alogA.getRnmCac().subtract(alogB.getRnmCac()));
        diff.setNmcRateDiff(alogA.getNmcRate().subtract(alogB.getNmcRate()));
        diff.setNmcGMVRateDiff(alogA.getNmcGMVRate().subtract(alogB.getNmcGMVRate()));
        diff.setPcmaGMVDiff(alogA.getPcmaGMV().subtract(alogB.getPcmaGMV()));
        diff.setMpcmaGMVDiff(alogA.getMpcmaGMV().subtract(alogB.getMpcmaGMV()));
        diff.setPcnGMVDiff(alogA.getPcnGMV().subtract(alogB.getPcnGMV()));
        diff.setPanGMVDiff(alogA.getPanGMV().subtract(alogB.getPanGMV()));
        diff.setMasmRateDiff(alogA.getMasmRate().subtract(alogB.getMasmRate()));
        diff.setMrrRateDiff(alogA.getMrrRate().subtract(alogB.getMrrRate()));

        return diff;
    }
}
